Change the eyecatcher to be case-insensitive, so that "Internal error" is
authorEwan Mellor <ewan@xensource.com>
Tue, 20 Mar 2007 17:26:05 +0000 (17:26 +0000)
committerEwan Mellor <ewan@xensource.com>
Tue, 20 Mar 2007 17:26:05 +0000 (17:26 +0000)
detected.

Signed-off-by: Tom Wilkie <tom.wilkie@gmail.com>
tools/xm-test/tests/block-create/07_block_attach_baddevice_neg.py
tools/xm-test/tests/block-create/08_block_attach_bad_filedevice_neg.py

index 3e9f0f25140641d8afb9edda3a89c20a6543ec9e..5d435e27c6f8ebb2bdd8bdd592620cb5dc38294c 100644 (file)
@@ -32,10 +32,10 @@ except ConsoleError, e:
 
 status, output = traceCommand("xm block-attach %s phy:NOT-EXIST xvda1 w" % domain.getName())
 eyecatcher = "Error"
-where = output.find(eyecatcher)
+where = re.compile(eyecatcher, re.IGNORECASE).search(output)
 if status == 0:
     FAIL("xm block-attach returned bad status, expected non 0, status is: %i" % status )
-elif where == -1:
+elif where is None:
     FAIL("xm block-attach returned bad output, expected Error, output is: %s" % output )
 
 try:
index 802e101147b953a2cb4f603e95501f809f20ce0b..2fa482414ada70f57d8e1c0784288a124919aa38 100644 (file)
@@ -31,10 +31,10 @@ except ConsoleError, e:
 
 status, output = traceCommand("xm block-attach %s file:/dev/NOT-EXIST xvda1 w" % domain.getName())
 eyecatcher = "Error"
-where = output.find(eyecatcher)
+where = re.compile(eyecatcher, re.IGNORECASE).search(output)
 if status == 0:
     FAIL("xm block-attach returned bad status, expected non 0, status is: %i" % status )
-elif where == -1:
+elif where is None:
     FAIL("xm block-attach returned bad output, expected Error, output is: %s" % output )
     
 try: